﻿@using System.Text.RegularExpressions;
@using DddCms.Models.UIComponent.Accordion;
@{
    Layout = "~/Views/Shared/_HomeLayout.cshtml";
}


@RenderBody()
 <script type="text/javascript">
     $(document).ready(function () {
         $("#secondaire").accordion({ height: 100 });
     });
</script>

@section Secondaire
{
   
      @RenderSection("Secondaire", false)
@{AccordionViewModelBuilder builer2 = Html.Accordion()
    .ID("secondaire")
    .Height(100)
    .CurrentOpenID((string)ViewData["CurrentOpenID"])
    .AddPannel((pannel) =>
    {
        pannel.SetIsOpen()
            .Title("Menu Utilisateur")
            .ID("editeur")
            .Icon("icon-user")
            .AddItemPannel(Html.ActionLink("Profile", ""), "icon-form");
        if (ViewContext.HttpContext.User.IsInRole("admin"))
            pannel.AddItemPannel(Html.ActionLink("Gestion des utilisateurs", "")); 
        return pannel;
    })
    .AddPannel(pannel => pannel
        .Title("Menu Editeur")
        .ID("editeur")
        .Icon("icon-app")
        .AddItemPannel(Html.ActionLink("Article", ""), "icon-data")
        .AddItemPannel(Html.ActionLink("Categorie", ""), "icon-data")
        .AddItemPannel(Html.ActionLink("Menu", ""), "icon-data"))
    .AddPannel(pannel => pannel
        .Title("Menu Editeur")
        .Icon("icon-admin")
        .AddItemPannel(Html.ActionLink("utilisateur", "")));
    }       
  @AccordionHelpers.AccordionRender(builer2.Build())
  }